<%@ page import="cn.model.File" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: wsx
  Date: 2017/1/16
  Time: 21:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>下载文件</title>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
</head>
<body>
<div class="table-responsive">
    <table class="table">
        <caption>文件列表</caption>
        <thead>
        <tr>
            <th>文件名称</th>
            <th>文件描述</th>
            <th></th>
        </tr>
        </thead>
        <tbody>
        <%
            List<File> list = ((List<File>) request.getAttribute("filelist"));
            if (null != list) {
                Iterator<File> it = list.iterator();
                while (it.hasNext()) {
                    File file = it.next();
                    out.println("<tr>");
                    out.println("<td>" + file.getFsname() + "</td>");
                    out.println("<td>" + file.getFdesc() + "</td>");
                    out.println("<td><a type=\"button\" class=\"btn btn-primary\" href=\"/downloadfile?filename=" + file.getFnewname() + "\">下载</a></td>");
                    out.println("</tr>");
                }
            }
        %>
        </tbody>
    </table>
</div>
<script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
